How to calculate students positions